package cn.fl.project.controller;

import cmm.mid.core.framework.page.ListPageVO;
import cmm.web.core.framework.controller.BaseController;
import cn.cmm.base.framework.constant.BaseConstant;
import cn.cmm.base.framework.utils.BaseLogUtils;
import cn.cmm.base.framework.utils.CollectionUtils;
import cn.cmm.base.framework.utils.StringUtils;
import cn.fl.capital.condition.CapPayInfoQueryCondition;
import cn.fl.capital.service.ICapPayInfoService;
import cn.fl.customer.service.ICstBscInfoService;
import cn.fl.customer.vo.CstBscInfoVO;
import cn.fl.fileconfig.condition.FileCfgConditonQC;
import cn.fl.framework.base.context.CurrentThreadContext;
import cn.fl.preloan.condition.PrjPrdInvoiceQueryCondition;
import cn.fl.project.service.IPrjPrdInvoiceService;
import cn.fl.project.vo.PrjFileInfoVO;
import cn.fl.project.vo.PrjPrdInvoiceVO;
import cn.fl.system.service.ISysUlDatCfgService;
import com.alibaba.fastjson.JSONObject;
import fl.customer.facade.customer.constant.CustomerConstant;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @Description: 付款信息表 控制层
 */
@Controller
@RequestMapping("/project/prjFileCfgInfo")
public class PrjFileCfgInfoController extends BaseController {
	private static final Logger logger = LoggerFactory.getLogger(PrjFileCfgInfoController.class);

	@Autowired
	private ISysUlDatCfgService sysUlDatCfgService;

	@Autowired
	private ICapPayInfoService capPayInfoService;

	@Autowired
	private ICstBscInfoService cstBscInfoService;

	@Autowired
	IPrjPrdInvoiceService prjPrdInvoiceService;
	/**
	 * 初始化客户资料列表
	 */
	@RequestMapping(value = "/initCstFileInfoList.do", method = {RequestMethod.GET})
	@ResponseBody
	public Object initCstFileInfoList(HttpServletRequest request, HttpServletResponse response) {
		String cstId = request.getParameter("cstId");//客户ID
		String prjId = request.getParameter("prjId");//项目ID
		String prjCstId = request.getParameter("prjCstId");//项目客户信息id
		String type=request.getParameter("type");
		String isShowSts=request.getParameter("isShowSts");
		if(StringUtils.isEmpty(isShowSts)){
			isShowSts= BaseConstant.IS_YESNO_YES_STR;
		}
		BaseLogUtils.info(logger, "initCstFileInfoList", "加载客户资料信息开始 cstId:"+cstId+",prjId:"+prjId);
		if(StringUtils.isEmpty(cstId) ||StringUtils.isEmpty(prjId)){
			BaseLogUtils.error(logger, "initCstFileInfoList", "请求信息为空");
			return new ListPageVO<PrjFileInfoVO>(new ArrayList<PrjFileInfoVO>(), 0);
		}
		String dateType;//自然人客户信息
		CstBscInfoVO cstBscInfoVO =this.cstBscInfoService.selectById(Long.valueOf(cstId));
		if (CustomerConstant.CST_TYP_CD_CORP.equals(cstBscInfoVO.getCstTypCd())) {//法人
			if("1".equals(type)) {
				dateType = "2";//法人客户信息
			}else{
				dateType = "4";//法人担保人信息
			}
		}else{
			if("1".equals(type)) {
				dateType = "1";//自然人客户信息
			}else{
				dateType = "3";//自然人担保人信息
			}
		}

		List<String> idList=new ArrayList<>();
		if ("3".equals(dateType) || "4".equals(dateType)){
			idList.add(prjCstId.toString());
		}
		idList.add(cstId.toString());
		FileCfgConditonQC fileQc=this.setFileCfgQc(Long.valueOf(prjId),idList,dateType);
		BaseLogUtils.info(logger, "initCstFileInfoList", "初始化客户上传资料列表.DATA:" + JSONObject.toJSONString(fileQc), CurrentThreadContext.getCurrentUserName());

		List<PrjFileInfoVO> list = this.sysUlDatCfgService.searchFileCfgList(fileQc,isShowSts);
		if (CollectionUtils.isNotEmpty(list)) {
			return new ListPageVO<PrjFileInfoVO>(list, list.size());
		}
		return new ListPageVO<PrjFileInfoVO>(new ArrayList<PrjFileInfoVO>(), 0);
	}

	/**
	 * 初始化项目资料列表
	 */
	@RequestMapping(value = "/initPrjFileInfoList.do", method = {RequestMethod.GET})
	@ResponseBody
	public Object initPrjFileInfoList(HttpServletRequest request, HttpServletResponse response) {
		String prjId = request.getParameter("prjId");//项目ID
		String isShowSts=request.getParameter("isShowSts");
		if(StringUtils.isEmpty(isShowSts)){
			isShowSts= BaseConstant.IS_YESNO_YES_STR;
		}
		BaseLogUtils.info(logger, "initCstFileInfoList", "加载客户资料信息开始 ,prjId:"+prjId);
		if(StringUtils.isEmpty(prjId)){
			BaseLogUtils.error(logger, "initCstFileInfoList", "请求信息为空");
			return new ListPageVO<PrjFileInfoVO>(new ArrayList<PrjFileInfoVO>(), 0);
		}

		List<String> idList=new ArrayList<>();
		idList.add(prjId.toString());

		FileCfgConditonQC fileQc=this.setFileCfgQc(Long.valueOf(prjId),idList,"5");
		BaseLogUtils.info(logger, "initCstFileInfoList", "初始化客户上传资料列表.DATA:" + JSONObject.toJSONString(fileQc), CurrentThreadContext.getCurrentUserName());

		List<PrjFileInfoVO> list = this.sysUlDatCfgService.searchFileCfgList(fileQc,isShowSts);
		if (CollectionUtils.isNotEmpty(list)) {
			return new ListPageVO<PrjFileInfoVO>(list, list.size());
		}
		return new ListPageVO<PrjFileInfoVO>(new ArrayList<PrjFileInfoVO>(), 0);
	}

	/**
	 * 初始化租赁物资料列表
	 */
	@RequestMapping(value = "/initPrjPrdDtlFileInfoList.do", method = {RequestMethod.GET})
	@ResponseBody
	public Object initPrjPrdDtlFileInfoList(HttpServletRequest request, HttpServletResponse response) {
		String prjPrdDtlId = request.getParameter("prjPrdDtlId");//项目产品明细ID
		String prjId = request.getParameter("prjId");//项目ID
		String prjPrdId = request.getParameter("prjPrdId");//车抵贷标识
		String isShowSts=request.getParameter("isShowSts");
		if(StringUtils.isEmpty(isShowSts)){
			isShowSts= BaseConstant.IS_YESNO_YES_STR;
		}
		BaseLogUtils.info(logger, "initPrjPrdDtlFileInfoList", "加载租赁物资料信息开始 ,prjId:"+prjId+",prjPrdDtlId:"+prjPrdDtlId+",prjPrdId:"+prjPrdId);
		if(StringUtils.isEmpty(prjId) ||StringUtils.isEmpty(prjPrdDtlId) ||StringUtils.isEmpty(prjPrdId)){
			BaseLogUtils.error(logger, "initPrjPrdDtlFileInfoList", "请求信息为空");
			return new ListPageVO<PrjFileInfoVO>(new ArrayList<PrjFileInfoVO>(), 0);
		}

		List<String> idList=new ArrayList<>();
        idList.add(prjPrdDtlId);
        FileCfgConditonQC fileQc=this.setFileCfgQc(Long.valueOf(prjId),idList,null);
        List<String> dataTypeList = Arrays.asList("6", "8");
        fileQc.setPrjPrdDtlId(Long.valueOf(prjPrdDtlId));
        fileQc.setPrjPrdId(Long.valueOf(prjPrdId));
        fileQc.setDataType(dataTypeList);
        BaseLogUtils.info(logger, "initMateList", "初始化上传资料列表qc=:" + JSONObject.toJSONString(fileQc) + CurrentThreadContext.getCurrentUserName());
        List<PrjFileInfoVO> prjFileInfoVOList = this.sysUlDatCfgService.searchFileCfgList(fileQc,isShowSts);
        BaseLogUtils.info(logger, "initMateList", "初始化上传资料列表结果" + JSONObject.toJSONString(prjFileInfoVOList), CurrentThreadContext.getCurrentUserName());
        if (CollectionUtils.isNotEmpty(prjFileInfoVOList)) {
            return new ListPageVO<>(prjFileInfoVOList, prjFileInfoVOList.size());
        }
		return new ListPageVO<>(new ArrayList<PrjFileInfoVO>(), 0);
	}

	/**
	 * 初始化保单资料列表
	 */
	@RequestMapping(value = "/initInsPlcFileInfoList.do", method = {RequestMethod.GET})
	@ResponseBody
	public Object initInsPlcFileInfoList(HttpServletRequest request, HttpServletResponse response) {
		String plcId = request.getParameter("plcId");//保单ID
		String prjId = request.getParameter("prjId");//项目ID
		String isShowSts=request.getParameter("isShowSts");
		if(StringUtils.isEmpty(isShowSts)){
			isShowSts= BaseConstant.IS_YESNO_YES_STR;
		}
		BaseLogUtils.info(logger, "initInsPlcFileInfoList", "加载保单资料信息开始 ,prjId:"+prjId+",plcId:"+plcId);
		if(StringUtils.isEmpty(prjId)){
			BaseLogUtils.error(logger, "initInsPlcFileInfoList", "请求信息为空");
			return new ListPageVO<PrjFileInfoVO>(new ArrayList<PrjFileInfoVO>(), 0);
		}

		List<String> idList=new ArrayList<>();
		idList.add(plcId);

		FileCfgConditonQC fileQc=this.setFileCfgQc(Long.valueOf(prjId),idList,"7");
		BaseLogUtils.info(logger, "initInsPlcFileInfoList", "初始化保单上传资料列表.DATA:" + JSONObject.toJSONString(fileQc), CurrentThreadContext.getCurrentUserName());

		List<PrjFileInfoVO> list = this.sysUlDatCfgService.searchFileCfgList(fileQc,isShowSts);
		if (CollectionUtils.isNotEmpty(list)) {
			return new ListPageVO<PrjFileInfoVO>(list, list.size());
		}
		return new ListPageVO<PrjFileInfoVO>(new ArrayList<PrjFileInfoVO>(), 0);
	}

	/**
	 * 初始化上传资料列表
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/initMateList.do", method = {RequestMethod.GET})
	@ResponseBody
	public Object initMateList(HttpServletRequest request, HttpServletResponse response) {
		//付款ID
		String id = request.getParameter("id");
		//产品明细ID
		String prjPrdDtlId = request.getParameter("prjPrdDtlId");
		//项目ID
		String prjId = request.getParameter("prjId");
		//付款状态
		String payStsCd = request.getParameter("payStsCd");
		//资料配置编号
		String mateCfgCd = request.getParameter("mateCfgCd");
		//项目类型
		String prjTypCd = request.getParameter("prjTypCd");
		//设置查询条件？
		CapPayInfoQueryCondition qc = new CapPayInfoQueryCondition();
		if (StringUtils.isNotBlank(id)) {
			qc.setId(Long.valueOf(id));
		}
		if (StringUtils.isNotEmpty(prjPrdDtlId)) {
			qc.setPrjPrdDtlId(Long.valueOf(prjPrdDtlId));
		}
		if (StringUtils.isNotBlank(payStsCd)) {
			qc.setPayStsCd(payStsCd);
		}
		if (StringUtils.isNotBlank(mateCfgCd)) {
			qc.setMateCfgCd(mateCfgCd);
		}
		if (StringUtils.isNotEmpty(prjId)) {
			qc.setPrjId(Long.valueOf(prjId));
		}
		if(StringUtils.isNotBlank(prjTypCd)){
			qc.setPrjTypCd(prjTypCd);
		}
        List<String> dataTypeList = Arrays.asList("6", "8");
        FileCfgConditonQC fileQc=this.setFileCfgQc(Long.valueOf(prjId),null,null);
        fileQc.setPrjPrdDtlId(Long.valueOf(prjPrdDtlId));
        fileQc.setDataType(dataTypeList);
        BaseLogUtils.info(logger, "initMateList", "初始化上传资料列表qc=:" + JSONObject.toJSONString(qc), CurrentThreadContext.getCurrentUserName());
        List<PrjFileInfoVO> list = this.capPayInfoService.searchMateFileList(qc,fileQc);
        BaseLogUtils.info(logger, "initMateList", "初始化上传资料列表结果" + JSONObject.toJSONString(list), CurrentThreadContext.getCurrentUserName());
        if (CollectionUtils.isNotEmpty(list)) {
            return new ListPageVO<>(list, list.size());
        }
		return new ListPageVO<PrjFileInfoVO>(new ArrayList<PrjFileInfoVO>(), 0);
	}

	/**
	 * 初始化发票资料列表
	 */
	@SuppressWarnings("unchecked")
	@RequestMapping(value = "/initInvoiceList.do", method = {RequestMethod.GET})
	@ResponseBody
	public Object initInvoiceList(HttpServletRequest request) {
		//数据主键集合
		List<String> idList = new ArrayList<>();
		//发票类型
		List<String> dataTypeList = Arrays.asList("9");
		FileCfgConditonQC fileQc = new FileCfgConditonQC();

		//项目ID
		String prjId = request.getParameter("prjId");
		//支付表号
		String paySchNo = request.getParameter("paySchNo");

		//根据项目id查询发票信息
		PrjPrdInvoiceQueryCondition invoiceQueryCondition = new PrjPrdInvoiceQueryCondition();
		invoiceQueryCondition.setPrjId(prjId);
		invoiceQueryCondition.setPaySchNo(paySchNo);
		List<PrjPrdInvoiceVO> prjPrdInvoiceList = prjPrdInvoiceService.searchPrjPrdInvoiceListByCondition(invoiceQueryCondition);
		if (CollectionUtils.isNotEmpty(prjPrdInvoiceList)) {
			for (PrjPrdInvoiceVO prjPrdInvoice : prjPrdInvoiceList) {
				idList.add(prjPrdInvoice.getId().toString());
			}
			fileQc.setIdsList(idList);
		}
		fileQc.setPrjID(Long.valueOf(prjId));
		fileQc.setDataType(dataTypeList);
		BaseLogUtils.info(logger, "initInvoiceList", "初始化发票资料列表.DATA:" + JSONObject.toJSONString(fileQc), CurrentThreadContext.getCurrentUserName());
		List<PrjFileInfoVO> prjFileInfoList = this.sysUlDatCfgService.searchFileCfgList(fileQc,BaseConstant.IS_YESNO_YES_STR);
		BaseLogUtils.info(logger, "initInvoiceList", "初始化发票资料列表结果" + JSONObject.toJSONString(prjFileInfoList), CurrentThreadContext.getCurrentUserName());
		if (CollectionUtils.isNotEmpty(prjFileInfoList)) {
			return new ListPageVO<PrjFileInfoVO>(prjFileInfoList, prjFileInfoList.size());
		}
		return new ListPageVO<PrjFileInfoVO>(new ArrayList<PrjFileInfoVO>(), 0);
	}

	/**
	 * 到担保人物资料页面
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping(value = "/toGuarFileInfoListPage.do", method = {RequestMethod.GET, RequestMethod.POST})
	public ModelAndView toGuarFileInfoListPage(HttpServletRequest request, HttpServletResponse response) {
		BaseLogUtils.info(logger, "toGuarFileInfoListPage", "加载到担保人物资料页面.", CurrentThreadContext.getCurrentUserName());
		ModelAndView mav = new ModelAndView("/project/prjFileInfo/prjGuarFileInfoList");
		String cstId = request.getParameter("cstId");//项目产品明细ID
		String ctrlKey = request.getParameter("ctrlKey");//控制键 1.可上传、下载、删除 2.可验证 3.不可操作
		String cstMgrOrgCd = request.getParameter("cstMgrOrgCd");//客户经理组织架构
		String prjId=request.getParameter("prjId");//项目id
		String prjCstId = request.getParameter("prjCstId");//项目客户信息表id
		mav.addObject("ctrlKey", ctrlKey);
		mav.addObject("cstId", cstId);
		mav.addObject("cstMgrOrgCd", cstMgrOrgCd);
		mav.addObject("prjId", prjId);
		mav.addObject("prjCstId", prjCstId);
		//********流程参数开始********//
		String preTaskIds = request.getParameter("preTaskIds");//流程上一个节点任务ID,多个以逗号分割.
		String pInstId = request.getParameter("pInstId");//流程实例ID
		mav.addObject("pInstId", pInstId);
		mav.addObject("preTaskIds", preTaskIds);
		//********流程参数结束********//

		mav.addObject("currentUsrId", CurrentThreadContext.getCurrentUserId());
		return mav;
	}

	/**
	 * 到租赁物资料页面
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping(value = "/toPrjPrdDtlFileInfoListPage.do", method = {RequestMethod.GET, RequestMethod.POST})
	public ModelAndView toPrjPrdDtlFileInfoListPage(HttpServletRequest request, HttpServletResponse response) {
		BaseLogUtils.info(logger, "toPrjPrdDtlFileInfoListPage", "加载到租赁物资料页面.", CurrentThreadContext.getCurrentUserName());
		ModelAndView mav = new ModelAndView("/project/prjFileInfo/prjPrdDtlFileInfoList");
		String prjPrdDtlId = request.getParameter("prjPrdDtlId");//项目产品明细ID
		String ctrlKey = request.getParameter("ctrlKey");//控制键 1.可上传、下载、删除 2.可验证 3.不可操作
		String cstMgrOrgCd = request.getParameter("cstMgrOrgCd");//客户经理组织架构
		String prjId = request.getParameter("prjId");//项目ID
		String prjTypCd = request.getParameter("prjTypCd");//项目类型
		String prjPrdId = request.getParameter("prjPrdId");//项目ID
		//支付表号
		String paySchNo = request.getParameter("paySchNo");

		mav.addObject("ctrlKey", ctrlKey);
		mav.addObject("prjPrdDtlId", prjPrdDtlId);
		mav.addObject("cstMgrOrgCd", cstMgrOrgCd);
		mav.addObject("prjId",prjId);
		mav.addObject("prjTypCd",prjTypCd);
		mav.addObject("prjPrdId",prjPrdId);
		mav.addObject("paySchNo",paySchNo);
		//********流程参数开始********//
		String preTaskIds = request.getParameter("preTaskIds");//流程上一个节点任务ID,多个以逗号分割.
		String pInstId = request.getParameter("pInstId");//流程实例ID
		mav.addObject("pInstId", pInstId);
		mav.addObject("preTaskIds", preTaskIds);
		//********流程参数结束********//

		mav.addObject("currentUsrId", CurrentThreadContext.getCurrentUserId());
		return mav;
	}

	/**
	 * 到保单资料页面
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping(value = "/toInsPlcBscInfoFileInfoListPage.do", method = {RequestMethod.GET, RequestMethod.POST})
	public ModelAndView toInsPlcBscInfoFileInfoListPage(HttpServletRequest request, HttpServletResponse response) {
		BaseLogUtils.info(logger, "toInsPlcBscInfoFileInfoListPage", "加载到保单资料页面.", CurrentThreadContext.getCurrentUserName());
		ModelAndView mav = new ModelAndView("/project/prjFileInfo/insPlcFileInfoList");
		String plcId = request.getParameter("plcId");//保单ID
		String ctrlKey = request.getParameter("ctrlKey");//控制键 1.可上传、下载、删除 2.可验证 3.不可操作
		String cstMgrOrgCd = request.getParameter("cstMgrOrgCd");//客户经理组织架构
		String prjId = request.getParameter("prjId");//项目ID

		mav.addObject("ctrlKey", ctrlKey);
		mav.addObject("plcId", plcId);
		mav.addObject("cstMgrOrgCd", cstMgrOrgCd);
		mav.addObject("prjId",prjId);
		//********流程参数开始********//
		String preTaskIds = request.getParameter("preTaskIds");//流程上一个节点任务ID,多个以逗号分割.
		String pInstId = request.getParameter("pInstId");//流程实例ID
		mav.addObject("pInstId", pInstId);
		mav.addObject("preTaskIds", preTaskIds);
		//********流程参数结束********//

		mav.addObject("currentUsrId", CurrentThreadContext.getCurrentUserId());
		return mav;
	}

	/**
	 * 到担保人物资料页面
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping(value = "/toGuarFileInfoListPageDetail.do", method = {RequestMethod.GET, RequestMethod.POST})
	public ModelAndView toGuarFileInfoListPageDetail(HttpServletRequest request, HttpServletResponse response) {
		BaseLogUtils.info(logger, "toGuarFileInfoListPage", "加载到担保人物资料页面.", CurrentThreadContext.getCurrentUserName());
		ModelAndView mav = new ModelAndView("/project/prjFileInfo/prjGuarFileInfoListDetail");
		String cstId = request.getParameter("cstId");//项目产品明细ID
		String ctrlKey = request.getParameter("ctrlKey");//控制键 1.可上传、下载、删除 2.可验证 3.不可操作
		String cstMgrOrgCd = request.getParameter("cstMgrOrgCd");//客户经理组织架构
		String prjId=request.getParameter("prjId");//项目id
		String prjCstId = request.getParameter("prjCstId");//项目客户信息表id
		mav.addObject("ctrlKey", ctrlKey);
		mav.addObject("cstId", cstId);
		mav.addObject("cstMgrOrgCd", cstMgrOrgCd);
		mav.addObject("prjId", prjId);
		mav.addObject("prjCstId", prjCstId);
		//********流程参数开始********//
		String preTaskIds = request.getParameter("preTaskIds");//流程上一个节点任务ID,多个以逗号分割.
		String pInstId = request.getParameter("pInstId");//流程实例ID
		mav.addObject("pInstId", pInstId);
		mav.addObject("preTaskIds", preTaskIds);
		//********流程参数结束********//

		mav.addObject("currentUsrId", CurrentThreadContext.getCurrentUserId());
		return mav;
	}

	/**
	 * 到租赁物资料页面
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping(value = "/toPrjPrdDtlFileInfoListPageDetail.do", method = {RequestMethod.GET, RequestMethod.POST})
	public ModelAndView toPrjPrdDtlFileInfoListPageDetail(HttpServletRequest request, HttpServletResponse response) {
		BaseLogUtils.info(logger, "toPrjPrdDtlFileInfoListPage", "加载到租赁物资料页面.", CurrentThreadContext.getCurrentUserName());
		ModelAndView mav = new ModelAndView("/project/prjFileInfo/prjPrdDtlFileInfoListDetail");
		String prjPrdDtlId = request.getParameter("prjPrdDtlId");//项目产品明细ID
		String ctrlKey = request.getParameter("ctrlKey");//控制键 1.可上传、下载、删除 2.可验证 3.不可操作
		String cstMgrOrgCd = request.getParameter("cstMgrOrgCd");//客户经理组织架构
		String prjId = request.getParameter("prjId");//项目ID
		String prjTypCd = request.getParameter("prjTypCd");//项目类型
		String prjPrdId = request.getParameter("prjPrdId");//项目ID
		//支付表号
		String paySchNo = request.getParameter("paySchNo");

		mav.addObject("ctrlKey", ctrlKey);
		mav.addObject("prjPrdDtlId", prjPrdDtlId);
		mav.addObject("cstMgrOrgCd", cstMgrOrgCd);
		mav.addObject("prjId",prjId);
		mav.addObject("prjTypCd",prjTypCd);
		mav.addObject("prjPrdId",prjPrdId);
		mav.addObject("paySchNo",paySchNo);
		//********流程参数开始********//
		String preTaskIds = request.getParameter("preTaskIds");//流程上一个节点任务ID,多个以逗号分割.
		String pInstId = request.getParameter("pInstId");//流程实例ID
		mav.addObject("pInstId", pInstId);
		mav.addObject("preTaskIds", preTaskIds);
		//********流程参数结束********//
		//融资外部机构专用
		mav.addObject("pianflag",request.getParameter("pianflag"));
		mav.addObject("currentUsrId", CurrentThreadContext.getCurrentUserId());
		return mav;
	}

	/**
	 * 到保单资料页面
	 * @param request
	 * @param response
	 * @return
	 */
	@RequestMapping(value = "/toInsPlcBscInfoFileInfoListPageDetail.do", method = {RequestMethod.GET, RequestMethod.POST})
	public ModelAndView toInsPlcBscInfoFileInfoListPageDetail(HttpServletRequest request, HttpServletResponse response) {
		BaseLogUtils.info(logger, "toInsPlcBscInfoFileInfoListPageDetail", "加载到保单资料页面.", CurrentThreadContext.getCurrentUserName());
		ModelAndView mav = new ModelAndView("/project/prjFileInfo/insPlcFileInfoListDetail");
		String plcId = request.getParameter("plcId");//保单ID
		String ctrlKey = request.getParameter("ctrlKey");//控制键 1.可上传、下载、删除 2.可验证 3.不可操作
		String cstMgrOrgCd = request.getParameter("cstMgrOrgCd");//客户经理组织架构
		String prjId = request.getParameter("prjId");//项目ID

		mav.addObject("ctrlKey", ctrlKey);
		mav.addObject("plcId", plcId);
		mav.addObject("cstMgrOrgCd", cstMgrOrgCd);
		mav.addObject("prjId",prjId);
		//********流程参数开始********//
		String preTaskIds = request.getParameter("preTaskIds");//流程上一个节点任务ID,多个以逗号分割.
		String pInstId = request.getParameter("pInstId");//流程实例ID
		mav.addObject("pInstId", pInstId);
		mav.addObject("preTaskIds", preTaskIds);
		//********流程参数结束********//

		mav.addObject("currentUsrId", CurrentThreadContext.getCurrentUserId());
		return mav;
	}

	private FileCfgConditonQC setFileCfgQc(Long prjId,List<String> idList,String dataType){
		FileCfgConditonQC qc=new FileCfgConditonQC();
		qc.setPrjID(prjId);
		qc.setIdsList(idList);
		List<String> dataTypes=new ArrayList<>();
		dataTypes.add(dataType);
		qc.setDataType(dataTypes);
		return qc;
	}

}

